
\newlength{\RoundedBoxWidth}
\newsavebox{\GrayRoundedBox}
\newenvironment{GrayBox}[1][\dimexpr\textwidth-4.5ex]
   {\setlength{\RoundedBoxWidth}{\dimexpr#1}
    \begin{lrbox}{\GrayRoundedBox}
       \begin{minipage}{\RoundedBoxWidth}}%
   {   \end{minipage}
    \end{lrbox}
    \begin{center}
    \begin{tikzpicture}%
       \draw node[draw=black,fill=black!10,rounded corners,%
             inner sep=2ex,text width=\RoundedBoxWidth]%
             {\usebox{\GrayRoundedBox}};
    \end{tikzpicture}
    \end{center}}

\xdefinecolor{hintboxtextcolor}{RGB}{64, 64, 64}

\newlength{\HintBoxWidth}
\newsavebox{\HintSaveBox}
\newenvironment{HintBox}[2][gnome-text-x-generic]
   {\def \hintpar {#1}
    \setlength{\HintBoxWidth}{\dimexpr\textwidth-4.5ex-40pt}
    \begin{lrbox}{\HintSaveBox}
       \begin{minipage}{\HintBoxWidth}\sffamily\small \textbf{#2:}\\}%
   {\end{minipage}
    \end{lrbox}
    \begin{center}
    \begin{tikzpicture}
      \matrix[ampersand replacement=\!, fill=gray!5, draw=gray!20]  {
        \node {\includegraphics[width=40pt]{\hintpar}}; 
        \! 
        \node {\usebox{\HintSaveBox}};\\
      };
    \end{tikzpicture}
    \end{center}}


\newenvironment{Hinweis}
{\begin{HintBox}[gnome-text-x-generic]{Tipp}}
{\end{HintBox}}

\newenvironment{Frage}
{\begin{HintBox}[gnome-help-faq]{Frage}}
{\end{HintBox}}




% =============================================================================%
% ======================== Umgebung fuer Aufgaben =============================%
% =============================================================================%
% =Definitions
% === Behauptung
% === Beweis
% === Aufgabe
\makeatletter
\iflanguage{english}{\def\college@language{english}}{}
\iflanguage{ngerman}{\def\college@language{german}}{}
\iflanguage{polish}{\def\college@language{polish}}{}

\ifthenelse{\equal{\college@language}{hello}}{
}{}

\ifthenelse{\equal{\college@language}{english}}{
  \def\college@proof{Proof}
  \def\college@assertion{Assertion}
  \def\college@precondition{Precondition}
  \def\college@exercise{Excercise}
}{}
\ifthenelse{\equal{\college@language}{german}}{
  \def\college@proof{Beweis}
  \def\college@assertion{Behauptung}
  \def\college@precondition{Voraussetzung}
  \def\college@exercise{Aufgabe}
}{}
\ifthenelse{\equal{\college@language}{polish}}{
  \def\college@proof{Beweis}
  \def\college@assertion{Behauptung}
  \def\college@precondition{Voraussetzung}
  \def\college@exercise{Aufgabe}
}{}
\makeatother
% ----------------------------- Voraussetzung -------------------------------- %
\newenvironment{Voraussetzung}
  {\begin{description}\item[Voraussetzung: ]}
%  {\begin{description}\item[\college@precondition: ]}
  {\end{description}}

% ----------------------------- Behauptung ------------------------------------%
\newenvironment{Behauptung}
  {\begin{description}\item[Behauptung: ]}
  {\end{description}}

% --------------------------------- Beweis ------------------------------------%
\newenvironment{Beweis}
  {\begin{description}\item[Beweis: ]}
  {\end{description}\hfill$\square$}

% -------------------------------- Aufgabe ------------------------------------%
\newcounter{exno}\setcounter{exno}{1}
\newcounter{partno}\setcounter{partno}{0}

\newenvironment{Aufgabe}
  {\par\vspace*{0.2in}  \usekomafont{subsubsection}\college@exercise { }\arabic{exno}\normalfont\normalsize\par}
  {
    \ifnum\value{partno}>0
      \end{enumerate}
    \fi
    
    \stepcounter{exno}
    \setcounter{partno}{0}
    \vspace*{0.1in}
  }

\newcommand{\Teil}
  {
    \ifnum\value{partno}>0
      \item
    \else
      \begin{enumerate}[\usekomafont{descriptionlabel} a)]\item
    \fi
    \setcounter{partno}{1}
  }
  
\newcommand{\EndTeil} {
  \ifnum\value{partno}>0
    \end{enumerate}
  \fi
  \setcounter{partno}{0}
}

